package com.jin.lazytool.task;

import java.util.concurrent.*;

public class ThreadUtils {

    private static final ThreadPoolExecutor es = new ThreadPoolExecutor(1, 1,
            0L, TimeUnit.MILLISECONDS,
            new LinkedBlockingQueue<Runnable>());

    public static void start(Runnable runnable){

        es.execute(runnable);
    }
    public static boolean executable(){
        if(es.getActiveCount() == 0){
            return true;
        }
        return false;
    }
}
